package com.ydy.shoot;

public class Airplane extends FlyingObject implements Enemy {

    private int speed = 2; //走步的步数


    /** 构造方法 */
    public Airplane(){
        image = ShootGame.airplane; //图片
        width = image.getWidth();   //宽
        height = image.getHeight(); //高
        x = (int) (Math.random()*(ShootGame.WIDTH-this.width));
//		x=100;
//		y=100;
    }

    /** 重写getScore() */
    public int getScore(){
        return 5;
    }

    /** 重写step() */
    public void step(){
        y+=speed; //y加(向下)
    }

    /** 重写outOfBounds() */
    public boolean outOfBounds(){
        return this.y>=ShootGame.HEIGHT; //敌机的y>=屏幕的高，即为越界
    }
}

